package com.beauty.product.repository;

import com.beauty.product.entity.Category;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface CategoryRepository extends JpaRepository<Category, Long> {
    
    Optional<Category> findByName(String name);
    
    List<Category> findByParentIdOrderBySort(Long parentId);
    
    List<Category> findByLevel(Integer level);
    
    List<Category> findByIsShowOrderBySort(Boolean isShow);
} 